﻿<navigation:Page x:Class="PmuRegistry.Silverlight.Pages.Manage.Measurements" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"  
           xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
           Title="NASPI PMU Registry: Manage Measurements">
    <Grid x:Name="GridManageMeasurements">        
        <Border Style="{StaticResource PortletBorderStyle}">
            <StackPanel Orientation="Vertical">
                <TextBlock x:Name="TextBlockHeading" Text="Manage Measurements" Foreground="#FFFFFFFF" HorizontalAlignment="Center" FontSize="{StaticResource LargerTextSize}" Padding="5" />
                <Border Background="{StaticResource PortletBackgroundBrush}">
                    <Grid x:Name="GridMeasurementDetail" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="5">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="2*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="3*" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="3*" />
                        </Grid.ColumnDefinitions>
                        
                        <TextBlock Grid.Row="0" Grid.Column="0" Text="Signal ID" Style="{StaticResource GenericLabelStyle}"/>
                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Path=SignalID}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5"/>
                        <TextBlock Grid.Row="0" Grid.Column="2" Text="Device" Style="{StaticResource GenericLabelStyle}"/>
                        <ComboBox x:Name="ComboBoxDevice" Grid.Row="0" Grid.Column="3" Margin="5" DisplayMemberPath="Value"></ComboBox>                        
                        <TextBlock Grid.Row="1" Grid.Column="0" Text="Signal Type" Style="{StaticResource GenericLabelStyle}"/>
                        <ComboBox x:Name="ComboBoxSignalType" Grid.Row="1" Grid.Column="1" Margin="5" DisplayMemberPath="Value"></ComboBox>
                        <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="2">
                            <TextBlock Text="Point Tag" Style="{StaticResource GenericLabelStyle}"/>
                            <TextBlock Text="*" Foreground="#FFCC0000" Style="{StaticResource GenericLabelStyle}" />
                        </StackPanel>
                        <TextBox x:Name="TextBoxPointTag" Grid.Row="1" Grid.Column="3" Text="{Binding Path=PointTag}" Width="{StaticResource XLargeItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />                        
                        <TextBlock Grid.Row="2" Grid.Column="0" Text="Alternate Tag" Style="{StaticResource GenericLabelStyle}"/>
                        <TextBox x:Name="TextBoxAlternateTag" Grid.Row="2" Grid.Column="1" Text="{Binding Path=AlternateTag}" Width="{StaticResource XLargeItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="2">
                            <TextBlock Text="Signal Reference" Style="{StaticResource GenericLabelStyle}"/>
                            <TextBlock Text="*" Foreground="#FFCC0000" Style="{StaticResource GenericLabelStyle}" />
                        </StackPanel>
                        <TextBox x:Name="TextBoxSignalReference" Grid.Row="2" Grid.Column="3" Text="{Binding Path=SignalReference}" Width="{StaticResource XLargeItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />                        
                        <TextBlock Grid.Row="3" Grid.Column="0" Text="Phasor Source" Style="{StaticResource GenericLabelStyle}"/>
                        <ComboBox x:Name="ComboBoxPhasorSource" Grid.Row="3" Grid.Column="1" Margin="5" DisplayMemberPath="Value"></ComboBox>
                        <TextBlock Grid.Row="3" Grid.Column="2" Text="Description" Style="{StaticResource GenericLabelStyle}"/>
                        <TextBox x:Name="TextBoxDescription" Grid.Row="3" Grid.Column="3" Text="{Binding Path=Description}" Width="{StaticResource XLargeItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="0">
                            <TextBlock Text="Adder" Style="{StaticResource GenericLabelStyle}"/>
                            <TextBlock Text="*" Foreground="#FFCC0000" Style="{StaticResource GenericLabelStyle}" />
                        </StackPanel>
                        <TextBox x:Name="TextBoxAdder" Grid.Row="4" Grid.Column="1" Text="{Binding Path=Adder}" Width="{StaticResource SmallerItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />
                        <StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="2">
                            <TextBlock Text="Multiplier" Style="{StaticResource GenericLabelStyle}"/>
                            <TextBlock Text="*" Foreground="#FFCC0000" Style="{StaticResource GenericLabelStyle}" />
                        </StackPanel>
                        <TextBox x:Name="TextBoxMultiplier" Grid.Row="4" Grid.Column="3" Text="{Binding Path=Multiplier}" Width="{StaticResource SmallerItemSize}" Height="{StaticResource XXXSmallItemSize}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Margin="5" />                        
                        <CheckBox x:Name="CheckboxEnabled" Grid.Row="5" Grid.Column="3" IsChecked="{Binding Path=Enabled}" Content="Enabled" VerticalAlignment="Center" FontWeight="Bold" Margin="5"/>
                        <StackPanel Orientation="Horizontal" Grid.Row="6" Grid.Column="3" HorizontalAlignment="Right" VerticalAlignment="Center">
                            <Button x:Name="ButtonClear" Content="../../Images/Cancel.png" Tag="Clear" Template="{StaticResource ImageButtonTemplate}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5" Cursor="Hand">
                                <Button.RenderTransform>
                                    <ScaleTransform x:Name="ButtonClearTransform" ScaleX="1" ScaleY="1" />
                                </Button.RenderTransform>
                            </Button>
                            <TextBlock Text="     "/>
                            <Button x:Name="ButtonSave" Content="../../Images/Save.png" Tag="Save" Template="{StaticResource ImageButtonTemplate}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5" Cursor="Hand">
                                <Button.RenderTransform>
                                    <ScaleTransform x:Name="ButtonSaveTransform" ScaleX="1" ScaleY="1" />
                                </Button.RenderTransform>
                            </Button>
                        </StackPanel>
                        <TextBlock x:Name="TextBlockMessage" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="6"/>
                    </Grid>
                </Border>
                <Border Style="{StaticResource HeaderRowBorderStyle}">
                    <StackPanel Orientation="Horizontal" Margin="2">                        
                        <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                            <TextBlock Text="Signal ID" Width="{StaticResource XLargeItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                        </Border>
                        <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                            <TextBlock Text="Device" Width="{StaticResource SmallerItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                        </Border>
                        <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                            <TextBlock Text="Point Tag" Width="{StaticResource LargerItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                        </Border>
                        <Border Style="{StaticResource HeaderRowCellBorderStyle}">
                            <TextBlock Text="Signal Reference" Width="{StaticResource LargeItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                        </Border>
                        <TextBlock Text="Enabled" Width="{StaticResource XSmallItemSize}" TextAlignment="Center" FontSize="{StaticResource LargeTextSize}" FontWeight="Bold"/>
                    </StackPanel>
                </Border>
                <Border Background="{StaticResource PortletBackgroundBrush}">
                    <ScrollViewer BorderThickness="0" Padding="0" Height="354">
                        <ScrollViewer.Content>
                            <ListBox x:Name="ListBoxMeasurementList" Margin="0" Padding="0">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" ToolTipService.ToolTip="{Binding Path=Description}">   
                                            <Border Style="{StaticResource ContentRowCellBorderStyle}">
                                                <TextBlock Text="{Binding Path=SignalID}" Width="{StaticResource XLargeItemSize}" TextAlignment="Left" Padding="1"/>
                                            </Border>
                                            <Border Style="{StaticResource ContentRowCellBorderStyle}">
                                                <TextBlock Text="{Binding Path=DeviceAcronym}" Width="{StaticResource SmallerItemSize}" TextAlignment="Left" Padding="1"/>
                                            </Border>
                                            <Border Style="{StaticResource ContentRowCellBorderStyle}">
                                                <TextBlock Text="{Binding Path=PointTag}" Width="{StaticResource LargerItemSize}" TextAlignment="Left" Padding="1"/>
                                            </Border>
                                            <Border Style="{StaticResource ContentRowCellBorderStyle}">
                                                <TextBlock Text="{Binding Path=SignalReference}" Width="{StaticResource LargeItemSize}" TextAlignment="Left" Padding="1"/>
                                            </Border>
                                            <Border Style="{StaticResource ContentRowCellBorderStyle}" Width="{StaticResource XSmallItemSize}">
                                                <CheckBox HorizontalAlignment="Center" IsChecked="{Binding Path=Enabled}" IsEnabled="False" />
                                            </Border>
                                        </StackPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </ScrollViewer.Content>
                    </ScrollViewer>
                </Border>
                <data:DataPager x:Name="DataPagerMeasurements" PageSize="14" AutoEllipsis="True" NumericButtonCount="3" DisplayMode="FirstLastPreviousNext"/>
            </StackPanel>
        </Border>
    </Grid>
</navigation:Page>
